<template>
	<view class="main">
		<uni-nav-bar title="工作台" fixed :border="false" height="88rpx" statusBar></uni-nav-bar>
		<view class="content">
			<view class="yuan" @click="goDetail('goodsCategory', { type: 0 })">商品供应链</view>
			<view class="yuan" @click="goDetail('autotrophyGoods')">商品自营</view>
			<view class="yuan" @click="goDetail('order')">订单</view>
			<!-- <view class="yuan" @click="goDetail('inventoryInfo')">库存</view> -->
			<view class="yuan" @click="goDetail('procure')">点采</view>
			<view class="yuan" @click="goDetail('inwarehouse')">入库</view>
			<view class="yuan" @click="goDetail('takeStock')">盘点</view>
			<!-- <view class="yuan" @click="goDetail('memberInfo')">会员</view> -->
			<view class="yuan" @click="goDetail('statement')">报表</view>
			<view class="yuan" @click="goDetail('finance')">财务</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "Index",
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		methods: {
			goDetail(val, params) {
				let par = ''
				if (params) {
					let keys = Object.keys(params);
					par = '?';
					for (let i = 0; i < keys.length; i++) {
						par += keys[i];
						par += '=';
						par += params[keys[i]];
						if (i + 1 != keys.length) {
							par += '&';
						}
					}
				}
				uni.navigateTo({
					url: '/pages/' + val + '/' + val + par
				})
			}
		}
	}
</script>
<style>
	page {
		background: #f7f7f7;
	}
</style>
<style lang="scss" scoped>
	view {
		box-sizing: border-box;
	}

	.content {

		display: flex;
		/* flex-direction: column; */
		align-items: center;
		justify-content: space-evenly;
		flex-wrap: wrap;
		padding: 40rpx;
		padding-top: 50rpx;
	}

	.yuan {
		margin-bottom: 30rpx;
		width: 45%;
		height: 200rpx;
		border-radius: 20rpx;
		border: 1px solid rgb(0, 140, 255);
		background-image: url("../../static/index/shopCard.png");
		background-size: 100% 100%;
		text-align: center;
		line-height: 200rpx;
		color: #fff;
		font-size: 40rpx;
		/* ... 其他样式 ... */
		transition: transform 0.2s, filter 0.2s; // 添加过渡效果，使动画更加平滑

		&:active {
			transform: scale(0.98); // 当卡片被激活时，将其缩放0.98，实现按压效果
			background-color: rgba(0, 0, 0, 0.1); // 可选：添加一点背景色变化
			filter: brightness(0.9); // 添加亮度滤镜，使卡片看起来稍微暗一些
		}
	}

	.yuan:nth-child(2n-1) {
		margin-right: 20rpx;
	}
</style>